﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using DAL;
namespace BLL
{
    public class MiniBiz
    {
        MiniDao miniDao = new MiniDao();
        public bool Insert(string tableName, SortedDictionary<string, string> sdList)
        {
            return miniDao.Insert(tableName, sdList);
        }
        public bool Update(string tableName, SortedDictionary<string, string> sdList)
        {
            return miniDao.Update(tableName, sdList);
        }
        //new string[] { "ID", id, "N" }
        public string Delete(string tableName, string[] primaryKey)
        {
            return miniDao.Delete(tableName, primaryKey);
        }

        #region   Hostel
        public bool DeleteHostel(string hostelCode)
        {
            return miniDao.DeleteHostel(hostelCode);
        }
        //获取一条记录
        public DataTable GetOneHostel(string hostelCode)
        {
            return miniDao.GetOneHostel(hostelCode);
        }
        public bool IsExistHostelCode(string hostelCode)
        {
            DataTable dt = GetOneHostel(hostelCode);
            if (dt.Rows.Count <= 0)
                return false;
            else
                return true;

        }
        //列表SQL
        public string GetHostelSQL(string serWord, string bTime, string eTime, string statu)
        {
            return miniDao.GetHostelSQL(serWord, bTime, eTime, statu);
        }
        //下拉列表用
        public DataTable GetHostelLists()
        {
            return miniDao.GetHostelLists();
        }
        //列表
        public DataTable GetHostelLists(string serWord, string bTime, string eTime, string statu)
        {
            return miniDao.GetHostelLists(serWord, bTime, eTime, statu);
        }


        //入住people
        public bool DeleteHostelEmp(string id)
        {
            return miniDao.DeleteHostelEmp(id);
        }
        //获取一条记录
        public DataTable GetOneHostelEmp(string id)
        {
            return miniDao.GetOneHostelEmp(id);
        }
        public DataTable GetOneHostelEmp(string empCode, string statu)
        {
            return miniDao.GetOneHostelEmp(empCode, statu);
        }
        public bool IsExistHostelEmp(string empCode, string statu)
        {
            DataTable dt = GetOneHostelEmp(empCode, statu);
            if (dt.Rows.Count <= 0)
                return false;
            else
                return true;

        }
        //列表SQL
        public string GetHostelEmpSQL(string serWord, string hostelCode, string statu)
        {
            return miniDao.GetHostelEmpSQL(serWord, hostelCode, statu);
        }
        public DataTable GetEmpByHostel(string hostelCode, string statu)
        {
            return miniDao.GetEmpByHostel(hostelCode, statu);
        }
        //列表
        public DataTable GetHostelEmpLists(string serWord, string hostelCode, string statu)
        {
            return miniDao.GetHostelEmpLists(serWord, hostelCode, statu);
        }
        public DataTable GetEmpFei(string strYear, string strMonth)
        {
            return miniDao.GetEmpFei(strYear, strMonth);
        }
        public DataTable GetEmpFei(string empCode, string strYear, string strMonth)
        {
            return miniDao.GetEmpFei(empCode,strYear, strMonth);
        }
        public bool IsExistFei(string empCode, string strYear, string strMonth)
        { 
            return miniDao.IsExistFei(empCode, strYear, strMonth); 
        }
        public bool IsInHostel(string empCode)
        {
            return miniDao.IsInHostel(empCode);
        }
        #endregion

        #region  car

        #endregion

        #region   zj
        public bool DeleteCred(string id)
        {
            return miniDao.DeleteCred(id);
        }
        //获取一条记录
        public DataTable GetOneCred(string id)
        {
            return miniDao.GetOneCred(id);
        }

        //列表
        public DataTable GetCredLists(string serWord)
        {
            return miniDao.GetCredLists(serWord);
        }
        public string GetCredNum(int dayNum, int getType)
        {
            return miniDao.GetCredNum(dayNum, getType);
        }
        #endregion
    }
}
